import { lazy } from "react"
import { Navigate } from "react-router-dom"
import RouterAuth from './RouterAuth'
//首页
let Index = lazy(() => import('../views/Index/Index'))
//登录页
let Login = lazy(() => import('../views/Login/Login'))
// 组织管理
let OrganizationManagement = lazy(() => import('../views/Index/Organization/OrganizationManagement/OrganizationManagement'))
//岗位管理
let JobManagement = lazy(() => import('../views/Index/Organization/JobManagement/JobManagement'))
//职务管理
let OfficeManagement = lazy(() => import('../views/Index/Organization/OfficeManagement/OfficeManagement'))
//home页
let Home = lazy(() => import('../views/Index/Home/Home'))
//人员管理
let Personnel = lazy(() => import('../views/Index/Personnel/Personnel.tsx'))
//转正管理
let Permoted = lazy(() => import('../views/Index/Promoted/Promoted'))
//转正页面
let PromotedSon = lazy(() => import('../views/Index/Promoted/PromotedSon/PromotedSon'))
//社保方案
let SocialSecurity = lazy(() => import('../views/Index/CorporateProtection/SocialSecurity/SocialSecurity'))
//公积金方案
let AccumulationFund = lazy(() => import('../views/Index/CorporateProtection/AccumulationFund/AccumulationFund'))
//用户管理
let User = lazy(() => import('../views/Index/System/User.tsx'))
// 角色管理
let Role = lazy(() => import('../views/Index/System/Role.tsx'))
// 个人中心
let Personal = lazy(() => import('../views/Index/System/Personal.tsx'))
// 工资发放
let Payroll = lazy(() => import('../views/Index/Salary/Payroll.tsx'))
// 工资发放详情
let Details = lazy(() => import('../views/Index/Salary/Details.tsx'))
//离职页面
let Leave = lazy(() => import('../views/Index/Promoted/Leave/Leave'))
//定薪模板页面
let SalaryFormWork = lazy(() => import('../views/Index/Salary/SalaryFormWork'))
//专项附加扣除
let Deduct = lazy(() => import('../views/Index/Deduct/Deduct'))
//参保档案
let Enrollmentfile = lazy(() => import('../views/Index/CorporateProtection/Enrollmentfile/Enrollmentfile'))
//薪资项目
let Salaryproject = lazy(() => import('../views/Index/Salaryaccounting/Salaryproject/Salaryproject'))
//薪资方案
let Salaryscheme = lazy(() => import('../views/Index/Salaryaccounting/Salaryscheme/Salaryscheme'))
//薪资台账
let Payrollledger = lazy(() => import('../views/Index/Salaryaccounting/Payrollledger/Payrollledger'))
//薪资调整
let Adjust=lazy(()=>import('../views/Index/Adjust/Adjust'))
//薪资档案
let SalaryFile=lazy(()=>import('../views/Index/SalaryFile/SalaryFile'))
//工资单设置
let Settings=lazy(()=>import('../views/Index/Salary/Settings'))
//404报错页面
let NotFound=lazy(()=>import('../views/NotFound/NotFound'))
// 发放工资
let Payoff = lazy(() => import('../views/Index/Salary/Payoff.tsx'))
// 详情
let Informaction = lazy(() => import('../views/Index/Salary/Informaction.tsx'))
// 累计应纳税所得额
let Duty = lazy(() => import('../views/Index/Duty/Duty.tsx'))
// 计税规则
let Taxsystem = lazy(() => import('../views/Index/Taxsystem/Taxsystem.tsx'))
// 考勤报表
let Attendanc = lazy(() => import('../views/Index/Attendanc/attendanc.tsx'))
// 假期计薪规则
let Holiday = lazy(() => import('../views/Index/Holiday/Holiday.tsx'))
// 全勤奖规则
let Fullattendance = lazy(() => import('../views/Index/Fullattendance/Fullattendance.tsx'))
export default [
    {
        path: '/index',
        element: <Index />,

        children: [
            {
                path: '/index/home',
                element: <RouterAuth perm='0-0-0'> <Home /> </RouterAuth>,
            },
            {
                path: '/index/OrganizationManagement',
                element: <RouterAuth perm='0-1-1'> <OrganizationManagement /> </RouterAuth>,
            },
            {
                path: '/index/JobManagement',
                element: <RouterAuth perm='0-1-2'> <JobManagement /> </RouterAuth>,
            },
            {
                path: '/index/OfficeManagement',
                element: <RouterAuth perm='0-1-3'> <OfficeManagement /> </RouterAuth>,
            },
            {
                path: '/index/personnel',
                element: <RouterAuth perm='0-2-1'> <Personnel /> </RouterAuth>,
            },
            {
                path: '/index/permoted',
                element: <RouterAuth perm='0-2-2'> <Permoted /> </RouterAuth>,
            },
            {
                path: '/index/promotedSon',
                element: <PromotedSon />,
            },
            {
                path: '/index/SocialSecurity',
                element: <RouterAuth perm='0-3-1'> <SocialSecurity /> </RouterAuth>,
            },
            {
                path: '/index/AccumulationFund',
                element: <RouterAuth perm='0-3-2'> <AccumulationFund /> </RouterAuth>,
            },
            {
                path: '/index/user',
                element: <RouterAuth perm='0-9-1'> <User /> </RouterAuth>,
            },
            {
                path: '/index/role',
                element: <RouterAuth perm='0-9-2'> <Role /> </RouterAuth>,
            },
            {
                path: '/index/payroll',
                element: <RouterAuth perm='0-8-2'> <Payroll /> </RouterAuth>,
            },
            {
                path: '/index/details',
                element: <Details />,
            },
            {
                path: '/index/leave',
                element: <RouterAuth perm='0-2-3'> <Leave /> </RouterAuth>,
            },
            {
                path: '/index/salaryFormWork',
                element: <RouterAuth perm='0-4-3'> <SalaryFormWork /> </RouterAuth>,
            },
            {
                path: '/index/personals',
                element: <RouterAuth perm='0-9-3'> <Personal /> </RouterAuth>,
            },
            {
                path: '/index/deduct',
                element: <RouterAuth perm='0-6-1'> <Deduct /> </RouterAuth>,
            },
            {
                path: '/index/Enrollmentfile',
                element: <RouterAuth perm='0-3-3'> <Enrollmentfile /> </RouterAuth>,
            },
            {
                path: '/index/Salaryproject',
                element: <RouterAuth perm='0-5-1'> <Salaryproject /> </RouterAuth>,
            },
            {
                path: '/index/Salaryscheme',
                element: <RouterAuth perm='0-5-2'> <Salaryscheme /> </RouterAuth>,
            },
            {
                path: '/index/Payrollledger',
                element: <RouterAuth perm='0-5-3'> <Payrollledger /> </RouterAuth>,
            },
            {
                path:'/index/adjust',
                element: <RouterAuth perm='0-4-2'> <Adjust /> </RouterAuth>,
            },
            {
                path:'/index/salaryFile',
                element: <RouterAuth perm='0-4-1'> <SalaryFile /> </RouterAuth>,
            },
            {
                path:'/index/settings',
                element: <RouterAuth perm='0-8-1'> <Settings /> </RouterAuth>,
            },
            {
                path:'/index/duty',
                element: <RouterAuth perm='0-6-2'> <Duty /> </RouterAuth>,
            },
            {
                path:'/index/Taxsystem',
                element: <RouterAuth perm='0-6-3'> <Taxsystem /> </RouterAuth>,
            },
            {
                path:'/index/attendanc',
                element: <RouterAuth perm='0-7-1'> <Attendanc /> </RouterAuth>,
            },
            {
                path:'/index/Holiday',
                element: <RouterAuth perm='0-7-1'> <Holiday /> </RouterAuth>,
            },
            {
                path:'/index/Fullattendance',
                element: <RouterAuth perm='0-7-1'> <Fullattendance /> </RouterAuth>,
            },
            {
                path: '/index/informaction',
                element: <Informaction />,
            },
            {
                path: '/index/payoff',
                element: <Payoff />,
            },
            {
                path: '/index',
                element: <Navigate to="/index/home" />
            },
            {
                path:'*',
                element: <NotFound />
            },
        ]
    },
    {
        path: '/login',
        element: <Login />
    },
    {
        path: '/',
        element: <Navigate to="/index" />
    },
    {
        path:'*',
        element: <NotFound />
    },
]